package br.com.arg.aplica.model;

import java.io.Serializable;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

import br.com.arg.aplica.util.SituacaoRegra;

@Entity
@XmlRootElement
//@Table(name="CAMPO", uniqueConstraints = @UniqueConstraint(columnNames = {"formato", "nome"}))
public class Tag implements Serializable {
	/** Default value included to remove warning. Remove or modify at will. **/
	private static final long serialVersionUID = 1L;
	
	public Tag()
	{
		this.nome = "Nome";
		this.descricao = "Descrição do compo Nome";
		this.regra = "semregra";
	}
	
	@Id
	@NotNull
	@GeneratedValue
	private int id;

	@NotNull
	@Size(min = 1, max = 32)
	private String nome;

	@NotNull
	@Size(min = 1, max = 255)
	private String descricao;

	@NotNull
	@Size(min = 1, max = 4096)
	private String regra;

	@Enumerated
	@NotNull
	@Column(name = "regra_situacao")
	private SituacaoRegra regraSituacao;
}
